/*
 * @Description  : 
 * @Author       : zhao
 * @Date         : 2022-06-28 11:16:19
 * @LastEditors  : zhao
 * @LastEditTime : 2023-02-01 15:16:01
 */


import { Message } from "element-ui"
import { MineralInfo } from "@/api/home"
const state = {

    isOpen: false, //

}

const mutations = {

}

const actions = {

    async getTableData({ dispatch, rootState, state }, getdata) {

        const { data, code } = await dispatch(state.url, state.searchData, { root: true })
    },
    async MineralInfo({ dispatch, rootState, state }, data) {

        return new Promise((resolve, reject) => {
            MineralInfo(data).then(res => {
                if (res.code == 200) {

                    resolve(res)
                } else {
                    Message.error(res.msg || "获取矿种失败")
                    resolve(res)
                }
            }).catch(error => {

                reject(error)
            })
        })
    }
}
const getters = {

}
export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}